﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Lion.WeiXin.Tests.Core
{
    [TestClass]
    public class AMessageHandlerTest
    {
        [TestMethod]
        public void ConvertIntToDateTest()
        {
            DateTime msgT = new DateTime(2012,9,28,11,31,0);
            string msg = @"<xml>
 <ToUserName><![CDATA[toUser]]></ToUserName>
 <FromUserName><![CDATA[fromUser]]></FromUserName> 
 <CreateTime>1348831860</CreateTime>
 <MsgType><![CDATA[text]]></MsgType>
 <Content><![CDATA[this is a test]]></Content>
 <MsgId>6072865224513765967</MsgId>
 </xml>";
            Lion.WeiXin.Core.Message.MsgModel model = new WeiXin.Core.Message.MsgModel(msg);

           DateTime dt= model.ConvertIntToDate(model.CreateTime);
           Assert.AreEqual(msgT, dt);
            
        }
   
    }
}
